home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / Developer Essentials May91 / MPW Interfaces & Libraries 3.2 / RIncludes / SIOW.r < prev    next >
Encoding:
Text File  |  1991-04-17  |  7.1 KB  |  370 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2. #
  3. #    Apple Macintosh Developer Technical Support
  4. #
  5. #    MultiFinder-Aware Simple Input/Output Window
  6. #
  7. #    SIOW
  8. #
  9. ------------------------------------------------------------------------------*/
  10.  
  11. #include "systypes.r"
  12. #include "types.r"
  13.  
  14. #include "SIOW.h"
  15.  
  16. #ifndef CREATOR
  17.     #define CREATOR 'siow'
  18. #endif
  19.  
  20. #ifndef FCREATOR
  21.     #define FCREATOR 'MPS '
  22. #endif
  23.  
  24. type 'pzza' {
  25.     literal longint;
  26. };
  27.  
  28. resource 'pzza' (128, purgeable) {
  29.     FCREATOR;
  30. };
  31.  
  32. /* we use an MBAR resource to conveniently load all the menus */
  33.  
  34. resource 'MBAR' (__rMenuBar, preload) {
  35.     { __mApple, __mFile, __mEdit, __mFont /*, __mSize */};        /* five menus */
  36. };
  37.  
  38.  
  39. resource 'MENU' (__mApple, preload) {
  40.     __mApple, textMenuProc,
  41.     0b1111111111111111111111111111101,    /* disable dashed line, enable About and DAs */
  42.     enabled, apple,
  43.     {
  44.         "About S I O W\311",
  45.             noicon, nokey, nomark, plain;
  46.         "-",
  47.             noicon, nokey, nomark, plain
  48.     }
  49. };
  50.  
  51. resource 'MENU' (__mFile, preload) {
  52.     __mFile, textMenuProc,
  53.     0b000000000000000000000000000000,    /* enable Quit only, program enables others */
  54.     enabled, "File",
  55.     {
  56.         "New",
  57.             noicon, "N", nomark, plain;
  58.         "Open",
  59.             noicon, "O", nomark, plain;
  60.         "-",
  61.             noicon, nokey, nomark, plain;
  62.         "Close",
  63.             noicon, "W", nomark, plain;
  64.         "Save",
  65.             noicon, "S", nomark, plain;
  66.         "Save As\311",
  67.             noicon, nokey, nomark, plain;
  68.         "-",
  69.             noicon, nokey, nomark, plain;
  70.         "Page Setup\311",
  71.             noicon, nokey, nomark, plain;
  72.         "Print\311",
  73.             noicon, nokey, nomark, plain;
  74.         "-",
  75.             noicon, nokey, nomark, plain;
  76.         "Quit",
  77.             noicon, "Q", nomark, plain
  78.     }
  79. };
  80.  
  81. resource 'MENU' (__mEdit, preload) {
  82.     __mEdit, textMenuProc,
  83.     0b0000000000000000000000000000000,    /* disable everything, program does the enabling */
  84.     enabled, "Edit",
  85.      {
  86.         "Undo",
  87.             noicon, "Z", nomark, plain;
  88.         "-",
  89.             noicon, nokey, nomark, plain;
  90.         "Cut",
  91.             noicon, "X", nomark, plain;
  92.         "Copy",
  93.             noicon, "C", nomark, plain;
  94.         "Paste",
  95.             noicon, "V", nomark, plain;
  96.         "Clear",
  97.             noicon, nokey, nomark, plain
  98.     }
  99. };
  100.  
  101. resource 'MENU' (__mFont, preload) {
  102.     __mFont, textMenuProc,
  103.     0b1111111111111111111111111111111,    /* enable everything */
  104.     enabled, "Font",
  105.      {
  106.      }
  107. };
  108.  
  109. /* this ALRT and DITL are used as an About screen */
  110.  
  111. resource 'ALRT' (__rAboutAlert, purgeable) {
  112.     {66, 58, 344, 396}, __rAboutAlert, {
  113.         OK, visible, silent;
  114.         OK, visible, silent;
  115.         OK, visible, silent;
  116.         OK, visible, silent
  117.     };
  118. };
  119.  
  120. resource 'DITL' (__rAboutAlert, purgeable) {
  121.     {    /* array DITLarray: 8 elements */
  122.         /* [1] */
  123.         {233, 144, 253, 224},
  124.         Button {
  125.             enabled,
  126.             "OK"
  127.         },
  128.         /* [2] */
  129.         {8, 72, 23, 264},
  130.         StaticText {
  131.             disabled,
  132.             "Simple Input/Output Window"
  133.         },
  134.         /* [3] */
  135.         {56, 24, 71, 337},
  136.         StaticText {
  137.             disabled,
  138.             "Copyright ©Apple Computer, Inc. 1989-1990 "
  139.         },
  140.         /* [4] */
  141.         {80, 108, 96, 244},
  142.         StaticText {
  143.             disabled,
  144.             "Brought to you by..."
  145.         },
  146.         /* [5] */
  147.         {109, 132, 134, 229},
  148.         StaticText {
  149.             disabled,
  150.             "\"PZZA SLT\""
  151.         },
  152.         /* [6] */
  153.         {176, 56, 200, 289},
  154.         StaticText {
  155.             disabled,
  156.             "Roger, Russ, Landon, Ira & Munch"
  157.         },
  158.         /* [7] */
  159.         {152, 24, 170, 212},
  160.         StaticText {
  161.             disabled,
  162.             "Special Thanks to..."
  163.         },
  164.         /* [8] */
  165.         {32, 152, 47, 200},
  166.         StaticText {
  167.             disabled,
  168.             "(SIOW)"
  169.         }
  170.     }
  171. };
  172.  
  173. /* this ALRT and DITL are used as an error screen */
  174.  
  175. resource 'ALRT' (__rUserAlert, purgeable) {
  176.     {40, 20, 150, 260},
  177.     __rUserAlert,
  178.     { /* array: 4 elements */
  179.         /* [1] */
  180.         OK, visible, silent,
  181.         /* [2] */
  182.         OK, visible, silent,
  183.         /* [3] */
  184.         OK, visible, silent,
  185.         /* [4] */
  186.         OK, visible, silent
  187.     }
  188. };
  189.  
  190.  
  191. resource 'DITL' (__rUserAlert, purgeable) {
  192.     { /* array DITLarray: 3 elements */
  193.         /* [1] */
  194.         {80, 150, 100, 230},
  195.         Button {
  196.             enabled,
  197.             "OK"
  198.         },
  199.         /* [2] */
  200.         {10, 60, 60, 230},
  201.         StaticText {
  202.             disabled,
  203.             "Error. ^0."
  204.         },
  205.         /* [3] */
  206.         {8, 8, 40, 40},
  207.         Icon {
  208.             disabled,
  209.             2
  210.         }
  211.     }
  212. };
  213.  
  214.  
  215. #define WindowHeight     286
  216. #define WindowWidth        480
  217.  
  218. resource 'WIND' (__rDocWindow, preload, purgeable) {
  219.     {0, 0, WindowHeight, WindowWidth},
  220.     zoomDocProc, invisible, noGoAway, 0x0, "untitled"
  221. };
  222.  
  223. resource 'CNTL' (__rVScroll, preload, purgeable) {
  224.     {-1, WindowWidth-15, WindowHeight-14, WindowWidth+1},
  225.     0, invisible, 0, 0, scrollBarProc, 0, ""
  226. };
  227.  
  228. resource 'CNTL' (__rHScroll, preload, purgeable) {
  229.     {WindowHeight-15, -1, WindowHeight+1, WindowWidth-14},
  230.     0, invisible, 0, 0, scrollBarProc, 0, ""
  231. };
  232.  
  233. resource 'STR#' (__kErrStrings, purgeable) {
  234.     {
  235.     "You must run on 512Ke or later";
  236.     "Application Memory Size is too small";
  237.     "Not enough memory to run SIOW";
  238.     "Not enough memory to do Cut";
  239.     "Cannot do Cut";
  240.     "Cannot do Copy";
  241.     "Cannot exceed 32,000 characters with Paste";
  242.     "Not enough memory to do Paste";
  243.     "Cannot create window";
  244.     "Cannot exceed 32,000 characters";
  245.     "Cannot do Paste"
  246.     "Font not found"
  247.     }
  248. };
  249.  
  250. /* here is the quintessential MultiFinder friendliness device, the SIZE resource */
  251.  
  252. resource 'SIZE' (-1) {
  253.     dontSaveScreen,
  254.     acceptSuspendResumeEvents,
  255.     enableOptionSwitch,
  256.     canBackground,                /* we can background; we don't currently, but our sleep value */
  257.                                 /* guarantees we don't hog the Mac while we are in the background */
  258.     multiFinderAware,            /* this says we do our own activate/deactivate; don't fake us out */
  259.     backgroundAndForeground,    /* this is definitely not a background-only application! */
  260.     dontGetFrontClicks,            /* change this is if you want "do first click" behavior like the Finder */
  261.     ignoreChildDiedEvents,        /* essentially, I'm not a debugger (sub-launching) */
  262.     not32BitCompatible,            /* this app should not be run in 32-bit address space */
  263.     reserved,
  264.     reserved,
  265.     reserved,
  266.     reserved,
  267.     reserved,
  268.     reserved,
  269.     reserved,
  270.     __kPrefSize * 1024,
  271.     __kMinSize * 1024    
  272. };
  273.  
  274.  
  275. type CREATOR as 'STR ';
  276.  
  277.  
  278. resource CREATOR (0) {
  279.     "MultiFinder-Aware Simple Input/Output Window (SIOW)"
  280. };
  281.  
  282.  
  283. resource 'BNDL' (128) {
  284.     CREATOR,
  285.     0,
  286.     {
  287.         'ICN#',
  288.         {
  289.             0, 128
  290.         },
  291.         'FREF',
  292.         {
  293.             0, 128
  294.         }
  295.     }
  296. };
  297.  
  298.  
  299. resource 'FREF' (128) {
  300.     'APPL',
  301.     0,
  302.     ""
  303. };
  304.  
  305.  
  306. resource 'ICN#' (128) {
  307.     {    /* array: 2 elements */
  308.         /* [1] */
  309.         $"0000 0000 0000 0000 0010 4100 0010 2200"
  310.         $"0020 2200 0020 2100 0020 4100 0010 4200"
  311.         $"0010 4200 0010 2200 0020 2100 0020 0100"
  312.         $"00FF FF00 03FF FFE0 0791 03F0 0ED1 0E7C"
  313.         $"1C31 321C 380D C10E 3FFF FFFE 3003 C106"
  314.         $"380D 300E 1E31 0E3C 1FC1 01F8 07FF FFE0"
  315.         $"00FF FE00",
  316.         /* [2] */
  317.         $"0000 0000 0000 0000 0010 4100 0010 2200"
  318.         $"0020 2200 0020 2100 0020 4100 0010 4200"
  319.         $"0010 4200 0010 2200 0020 2100 0020 0100"
  320.         $"00FF FF00 03FF FFE0 07FF FFF0 0FFF FFFC"
  321.         $"1FFF FFFC 3FFF FFFE 3FFF FFFE 3FFF FFFE"
  322.         $"3FFF FFFE 1FFF FFFC 1FFF FFF8 07FF FFE0"
  323.         $"00FF FE00"
  324.     }
  325. };
  326.  
  327. resource 'ALRT' (__rSaveAlert, preload) {
  328.     {72, 64, 212, 372},
  329.     __rSaveAlert,
  330.     {    /* array: 4 elements */
  331.         /* [1] */
  332.         OK, visible, silent,
  333.         /* [2] */
  334.         OK, visible, silent,
  335.         /* [3] */
  336.         OK, visible, silent,
  337.         /* [4] */
  338.         OK, visible, silent
  339.     }
  340. };
  341.  
  342. resource 'DITL' (__rSaveAlert, preload) {
  343.     {    /* array DITLarray: 4 elements */
  344.         /* [1] */
  345.         {58, 25, 76, 99},
  346.         Button {
  347.             enabled,
  348.             "Yes"
  349.         },
  350.         /* [2] */
  351.         {86, 25, 104, 99},
  352.         Button {
  353.             enabled,
  354.             "No"
  355.         },
  356.         /* [3] */
  357.         {12, 20, 45, 277},
  358.         StaticText {
  359.             disabled,
  360.             "Save changes before closing?"
  361.         },
  362.         /* [4] */
  363.         {86, 195, 104, 269},
  364.         Button {
  365.             enabled,
  366.             "Cancel"
  367.         }
  368.     }
  369. };
  370.